//
//  GYGoodsDetailesCollectionViewCell.m
//  GoodLuck
//
//  Created by apple on 2018/5/8.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYGoodsDetailesCollectionViewCell.h"
#import "SJAvatarBrowser.h"

@interface GYGoodsDetailesCollectionViewCell()
@property (weak, nonatomic) IBOutlet UILabel *titleDeslable;
@property (weak, nonatomic) IBOutlet UIImageView *imageDes;

@end

@implementation GYGoodsDetailesCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];
    [self.imageDes addGestureRecognizer:tapGR];
}

- (void)tap:(UITapGestureRecognizer *)tapGR {
    [SJAvatarBrowser showImage:(UIImageView *)tapGR.view];
}

- (void)setModel:(GYShopDetailes *)model {
    _model = model;
    
    if ([model.type isEqualToString:@"image"]) {
        self.titleDeslable.text = @"";
        [self.imageDes sd_setImageWithURL:[NSURL URLWithString:model.value] placeholderImage:[UIImage imageNamed:@"4"]];
    }else {
        self.titleDeslable.text = model.value;
        self.imageDes.image = nil;
    }
}


@end
